home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / unarced / graphics / pbmplus / pgm / libpgm.man < prev    next >
Text File  |  1995-03-17  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4.      libpgm(3)                     AMIGA                     libpgm(3)
  5.  
  6.  
  7.  
  8.      NAME
  9.           libpgm - functions to support portable graymap programs
  10.  
  11.      SYNOPSIS
  12.           #include <pgm.h>
  13.           cc ... libpgm.a libpbm.a
  14.  
  15.  
  16.      DESCRIPTION
  17.         TYPES AND CONSTANTS
  18.           typedef ... gray;
  19.           #define PGM_MAXMAXVAL ...
  20.           extern gray pgm_pbmmaxval;
  21.  
  22.           Each gray should contain only the values between 0 and
  23.           PGM_MAXMAXVAL.  pgm_pbmmaxval is the maxval used when a PGM
  24.           program reads a PBM file.  Normally it is 1; however, for
  25.           some programs, a larger value gives better results.
  26.  
  27.           #define PGM_FORMAT ...
  28.           #define RPGM_FORMAT ...
  29.           #define PGM_TYPE PGM_FORMAT
  30.           int PGM_FORMAT_TYPE( int format )
  31.  
  32.           For distinguishing different file formats and types.
  33.  
  34.         INITIALIZATION
  35.           void pgm_init( int* argcP, char* argv[] )
  36.  
  37.           All PGM programs must call this routine.
  38.  
  39.         MEMORY MANAGEMENT
  40.           gray** pgm_allocarray( int cols, int rows )
  41.  
  42.           Allocate an array of grays.
  43.  
  44.           gray* pgm_allocrow( int cols )
  45.  
  46.           Allocate a row of the given number of grays.
  47.  
  48.           void pgm_freearray( gray** grays, int rows )
  49.  
  50.           Free the array allocated with pgm_allocarray() containing
  51.           the given number of rows.
  52.  
  53.           void pgm_freerow( gray* grayrow )
  54.  
  55.           Free a row of grays.
  56.  
  57.         READING FILES
  58.           void pgm_readpgminit( FILE* fp, int* colsP, int* rowsP, gray* maxvalP, int* formatP )
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                         (printed 10/19/91)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      libpgm(3)                     AMIGA                     libpgm(3)
  71.  
  72.  
  73.  
  74.           Read the header from a PGM file, filling in the rows, cols,
  75.           maxval and format variables.
  76.  
  77.           void pgm_readpgmrow( FILE* fp, gray* grayrow, int cols, gray maxval, int format )
  78.  
  79.           Read a row of grays into the grayrow array.  Format, cols,
  80.           and maxval were filled in by pgm_readpgminit().
  81.  
  82.           gray** pgm_readpgm( FILE* fp, int* colsP, int* rowsP, gray* maxvalP )
  83.  
  84.           Read an entire graymap file into memory, returning the
  85.           allocated array and filling in the rows, cols and maxval
  86.           variables.  This function combines pgm_readpgminit(),
  87.           pgm_allocarray() and pgm_readpgmrow().
  88.  
  89.         WRITING FILES
  90.           void pgm_writepgminit( FILE* fp, int cols, int rows, gray maxval, int forceplain )
  91.  
  92.           Write the header for a portable graymap file.  The
  93.           forceplain flag forces a plain-format file to be written, as
  94.           opposed to a raw-format one.
  95.  
  96.           void pgm_writepgmrow( FILE* fp, gray* grayrow, int cols, gray maxval, int forceplain )
  97.  
  98.           Write a row from a portable graymap.
  99.  
  100.           void pgm_writepgm( FILE* fp, gray** grays, int cols, int rows, gray maxval, int forceplain )
  101.  
  102.           Write the header and all data for a portable graymap.  This
  103.           function combines pgm_writepgminit() and pgm_writepgmrow().
  104.  
  105.      SEE ALSO
  106.           libpbm(3), libppm(3), libpnm(3)
  107.  
  108.      AUTHOR
  109.           Copyright (C) 1989, 1991 by Tony Hansen and Jef Poskanzer.
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                         (printed 10/19/91)
  130.  
  131.  
  132.  
  133.